package com.yuhanginfo.modules.sys.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yuhanginfo.common.service.CrudService;
import com.yuhanginfo.modules.sys.dao.CreditDao;
import com.yuhanginfo.modules.sys.entity.Credit;

/**
 * 信用额度Service
 * @author lvls
 * @version 2017-09-21
 */
@Service
@Transactional(readOnly = true)
public class CreditService extends CrudService<CreditDao, Credit> {

	@Autowired
	private CreditDao creditDao;
	
	
	
	@Transactional(readOnly = false)
	public void save(Credit credit) {
		super.save(credit);
	}
	
	@Transactional(readOnly = false)
	public void delete(Credit credit) {
		super.delete(credit);
	}

	public Credit selectByUserId(String userId) {
		return creditDao.selectByUserId(userId);
	}

	public int changeStatus(Credit credit) {
		return creditDao.changeStatus(credit);
	}
    
	@Transactional(readOnly = false)
	public void updateUseMoney(Credit credit) {
		creditDao.updateUseMoney(credit);
		
	}
	
}